package top.jle.wx.proxy.domain.invoice;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Schema(title="发票卡券模板")
@Getter
@Setter
public class CardInfo {

    @Schema(title="发票类型 eg:四川省增值税普通发票")
    private String type;
    @Schema(title="收款方（开票方）全称",description = "显示在发票详情内。故建议一个收款方对应一个发票卡券模板")
    private String payee;
    private BaseInfo base_info;
    @Schema(title="发票卡券模板BaseInfo")
    @Getter
    @Setter
    static class BaseInfo{
        @Schema(title="发票商家LOGO")
        private String logo_url;
        @Schema(title="收款方",description = "显示在列表，上限为 9 个汉字，建议填入商户简称")
        private String title;
        public boolean valid(){
            return StringUtils.isNotBlank(this.logo_url) && StringUtils.isNotBlank(this.title);
        }
    }
    public boolean valid(){
        return StringUtils.isNotBlank(this.type) && StringUtils.isNotBlank(payee) && base_info!=null && base_info.valid();
    }
}
